import tensorflow as tf

def distancel1(x, x_):
    return tf.reduce_mean(tf.abs(x - x_))

def distancel2(x, x_):
    return tf.reduce_mean(tf.square(x - x_))

def lossCompute(x, isReal):
    if isReal:
        labels = tf.ones_like(x)
    else:
        labels = tf.zeros_like(x)
    return tf.compat.v1.losses.sigmoid_cross_entropy(logits = x,
                                                     multi_class_labels = labels)